<div class="bg-light lter b-b wrapper-md ng-scope">
    <h4 class="m-n font-thin">添加银行卡</h4>
    <button ui-sref="app.bankCard" class="btn-back btn btn-dark btn-sm btn-rounded">
        返回
    </button>
</div>
<div class="wrapper" ng-controller="bankCardAddCtrl">
    <div class="panel panel-default">
        <div class="panel-heading m-n">
            添加银行卡信息
        </div>
        <div class="panel-body">
            <div class="panel-default panel-body">
                <form name="bankCardInfo" class="form-horizontal form-validation">
                    <div class="form-group m-b-md">
                        <label class="col-sm-2 control-label font-bold">账户类型</label>
                        <div class="col-sm-5">
                            <div class="radio">
                                <label class="i-checks i-checks-sm">
                                    <input type="radio" name="bankStatus" ng-model="type.state" ng-click="change()" value="0">
                                    <i></i>
                                    企业银行卡
                                </label>
                                <label class="i-checks i-checks-sm">
                                    <input type="radio" name="bankStatus" ng-model="type.state"  ng-click="change()" value="1">
                                    <i></i>
                                    个人银行卡
                                </label>
                            </div>
                        </div>
                    </div>
                    <div class="form-group m-b-md" ng-if="type.state==1">

                        <label class="col-sm-2 control-label font-bold">持卡人姓名</label>
                        <div class="col-sm-5">
                            <input type="text" ng-model="bankCardVO.name" name="name" class="form-control" placeholder="请输入真实姓名" required>
                        </div>
                        <div class="col-sm-5 form-text" ng-if="bankCardInfo.name.$touched">
                            <span class="text-danger" ng-if="bankCardInfo.name.$error.required">持卡人姓名是必填的</span>
                        </div>
                    </div>
                    <div class="form-group m-b-md" ng-if="type.state==0">
                        <label class="col-sm-2 control-label font-bold">公司名称</label>
                        <div class="col-sm-5">
                            <input type="text" ng-model="bankCardVO.companyName" name="companyName" class="form-control" placeholder="请输入公司注册时的全称" required>
                        </div>
                        <div class="col-sm-5 form-text" ng-if="bankCardInfo.companyName.$touched">
                            <span class="text-danger" ng-if="bankCardInfo.companyName.$error.required">公司名称是必填的</span>
                        </div>
                    </div>
                    <div class="form-group m-b-md" ng-if="type.state==0">
                        <label class="col-sm-2 control-label font-bold">纳税人识别号</label>
                        <div class="col-sm-5">
                            <input type="text" ng-model="bankCardVO.taxpayerNumber" name="taxpayerNumber" class="form-control" placeholder="请输入纳税人识别号,以便开具发票" required>
                        </div>
                        <div class="col-sm-5 form-text" ng-if="bankCardInfo.taxpayerNumber.$touched">
                            <span class="text-danger" ng-if="bankCardInfo.taxpayerNumber.$error.required">纳税人识别号是必填的</span>
                        </div>
                    </div>
                    <div class="form-group m-b-md" ng-if="type.state==0">
                        <label class="col-sm-2 control-label font-bold">联系方式</label>
                        <div class="col-sm-5">
                            <input type="text" ng-model="bankCardVO.companyPhone" name="companyPhone" class="form-control" placeholder="请输入公司联系方式" required>
                        </div>
                        <div class="col-sm-5 form-text" ng-if="bankCardInfo.companyPhone.$touched">
                            <span class="text-danger" ng-if="bankCardInfo.companyPhone.$error.required">联系方式是必填的</span>
                        </div>
                    </div>
                    <div class="form-group m-b-md" ng-if="type.state==1">
                        <label class="col-sm-2 control-label font-bold">联系方式</label>
                        <div class="col-sm-5">
                            <input type="text" ng-model="bankCardVO.userPhone" name="phone" class="form-control" maxlength="11" placeholder="请输入在银行中预留的手机号码" ng-pattern="/^1[34578]\d{9}$/" required>
                        </div>
                        <div class="col-sm-5 form-text" ng-if="bankCardInfo.phone.$touched">
                            <span class="text-danger" ng-if="bankCardInfo.phone.$error.required">联系方式是必填的</span>
                            <span class="text-danger" ng-if="bankCardInfo.phone.$error.pattern">请填写正确的手机号</span>
                        </div>
                    </div>
                    <div class="form-group m-b-md" ng-if="type.state==0">
                        <label class="col-sm-2 control-label font-bold">公司地址</label>
                        <div class="col-sm-5">
                            <input type="text" ng-model="bankCardVO.companyAddress" name="companyAddress" class="form-control" placeholder="请输入公司地址,以便开具发票" required>
                        </div>
                        <div class="col-sm-5 form-text" ng-if="bankCardInfo.companyAddress.$touched">
                            <span class="text-danger" ng-if="bankCardInfo.companyAddress.$error.required">公司地址是必填的</span>
                        </div>
                    </div>
                    <div class="form-group m-b-md">
                        <label class="col-sm-2 control-label font-bold">银行卡号</label>
                        <div class="col-sm-5">
                            <input type="text" ng-model="bankCardVO.bankCard" name="bankCard" class="form-control" placeholder="请输入准确的银行卡号" required>
                        </div>
                        <div class="col-sm-5 form-text" ng-if="bankCardInfo.bankCard.$touched">
                            <span class="text-danger" ng-if="bankCardInfo.bankCard.$error.required">银行卡号是必填的</span>
                        </div>
                    </div>
                    <div class="form-group m-b-md" ng-if="type.state==1">
                        <label class="col-sm-2 control-label font-bold">身份证号</label>
                        <div class="col-sm-5">
                            <input type="text" ng-model="bankCardVO.identityNumber" name="identityNumber" maxlength="18" class="form-control" placeholder="请输入准确的身份证号" required>
                        </div>
                        <div class="col-sm-5 form-text" ng-if="bankCardInfo.identityNumber.$touched">
                            <span class="text-danger" ng-if="bankCardInfo.identityNumber.$error.required">身份证号是必填的</span>
                        </div>
                    </div>
                    <div class="form-group m-b-md">
                        <label class="col-sm-2 control-label font-bold">开户银行</label>
                        <div class="col-sm-5">
                            <select class="form-control  inline m-r-xs col-sm-5 w-full" name="BankLogo" ng-model="bankCardVO.BankLogo" required>
                                <option value="">< - - 请选择银行 - - ></option>
                                <option value="0">中国银行</option>
                                <option value="1">建设银行</option>
                                <option value="2">农业银行</option>
                                <option value="3">工商银行</option>
                                <option value="4">交通银行</option>
                                <option value="5">邮储银行</option>
                                <option value="6">中信银行</option>
                                <option value="7">光大银行</option>
                                <option value="8">华夏银行</option>
                                <option value="9">广发银行</option>
                                <option value="10">平安银行</option>
                                <option value="11">招商银行</option>
                                <option value="12">浦发银行</option>
                                <option value="13">兴业银行</option>
                                <option value="14">民生银行</option>
                                <option value="15">恒丰银行</option>
                                <option value="16">浙商银行</option>
                                <option value="17">渤海银行</option>
                                <option value="18">农商银行</option>
                            </select>
                        </div>
                        <div class="col-sm-5 form-text" ng-if="bankCardInfo.BankLogo.$touched">
                            <span class="text-danger" ng-if="bankCardInfo.BankLogo.$error.required">开户银行是必填的</span>
                        </div>
                    </div>
                    <div class="form-group m-b-md">
                        <label class="col-sm-2 control-label font-bold">开户行名称</label>
                        <div class="col-sm-5">
                            <input type="text" ng-model="bankCardVO.bankAddress" name="address" class="form-control" placeholder="请输入开户行名称" required>
                        </div>
                        <div class="col-sm-5 form-text" ng-if="bankCardInfo.address.$touched">
                            <span class="text-danger" ng-if="bankCardInfo.address.$error.required">银行卡开户行名称是必填的</span>
                        </div>
                    </div>
                    <div class="form-group m-b-md" ng-if="type.state==1">
                        <label class="col-sm-2 control-label font-bold">手机验证码</label>
                        <div class="col-sm-5">
                            <input type="text" class="form-control" placeholder="请输入接收到的手机号验证码" name="code" maxlength="6" ng-model="bankCardVO.code" required>
                            <div ng-if="bankCardInfo.code.$touched">
                                <label class="pull-left text-left text-danger h6 l-h" ng-if="bankCardInfo.code.$error.required">验证码为必填项</label>
                            </div>
                        </div>
                        <div class="col-md-3">
                            <div class="btn btn-success" ng-click="check()" ng-bind="description" ng-disabled="canClick"></div>
                        </div>
                    </div>
                    <div class="line line-dashed b-b line-lg pull-in"></div>
                    <div class="form-group">
                        <div class="col-sm-4 col-sm-offset-2">
                            <button type="submit" class="btn btn-success" ng-disabled="bankCardInfo.$invalid || type.count<=0" ng-click="confirmInfo()" ng-if="type.state==1">保存</button>
                            <button type="submit" class="btn btn-success" ng-disabled="bankCardInfo.$invalid || type.count<=0" ng-click="confirmBank()" ng-if="type.state==0">保存</button>
                            <span class="text-danger">(今日剩余绑定次数：{{type.count}}次)</span>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>